package com.hctforgreen.greenservice.model;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 1、提交大机组信息时获取服务端返回的信息
 * 
 *******2、大机组调试报完成
 * 
 * @author 390694
 * 
 */
public class SubmitBigUnitInfoEntity extends BaseEntity {
	private static final long serialVersionUID = 439712719693268736L;

	public String statusCode = "";
	public String msg = "";

	/**
	 * 开机密码状态 0：正常 其他：异常（待定）
	 */
	public String unitStatus = "";
	/**
	 * 返回信息
	 */
	public String unitMsg = "";
	/**
	 * 开机密码
	 */
	public String unitPwd = "";

	public final static String STATUS_CODE = "statusCode";
	public final static String MSG = "msg";

	public final static String UNIT_STATUS = "unitStatus";
	public final static String UNIT_MSG = "unitMsg";
	public final static String UNIT_PWD = "unitPwd";

	public static SubmitBigUnitInfoEntity parse(JSONObject jsonObject)
			throws JSONException {
		SubmitBigUnitInfoEntity bean = new SubmitBigUnitInfoEntity();
		if (jsonObject.has(STATUS_CODE)) {
			bean.statusCode = jsonObject.getString(STATUS_CODE);
		}
		if (jsonObject.has(MSG)) {
			bean.msg = jsonObject.getString(MSG);
		}
		if (jsonObject.has(UNIT_STATUS)) {
			bean.unitStatus = jsonObject.getString(UNIT_STATUS);
		}
		if (jsonObject.has(UNIT_MSG)) {
			bean.unitMsg = jsonObject.getString(UNIT_MSG);
		}
		if (jsonObject.has(UNIT_PWD)) {
			bean.unitPwd = jsonObject.getString(UNIT_PWD);
		}
		return bean;

	}

}
